<?php

class ActionLogin extends BaseAction
{
    public function run()
    {
        $oUser = new User('login');
        
        if ( Yii::app()->request->getIsPostRequest() )
        {
            $oUser->setAttributesFromRequest('aLogin');
            
            if ( $oUser->validate() )
            {
                Yii::app()->controller->redirect('/admin');
            }
        }

        $this->template->oUser = $oUser;
    }
}